<%
	String version = "?version="+Math.random();
%>
<script type="text/javascript" src="<c:url value='/scripts/global.js${version }'/>"></script>

<script type="text/javascript" src="<c:url value='/scripts/jquery-1.11.0.min.js${version }'/>"></script>

<%--prototype --%>
<script type='text/javascript' src="<c:url value='/scripts/jquery.dcmegamenu.1.3.3.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.hoverIntent.minified.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.menuScrollTop.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.tab.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.tablescroll.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.TRhoverEffect.js${version }'/>"></script>

<script type="text/javascript" src="<c:url value='/scripts/jquery.form.min.js${version }'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/jquery-validation/jquery.validate.min.js${version }'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/jquery-validation/localization/messages_zh.js${version }'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/jquery-validation/localization/messages_zh_TW.js${version }'/>"></script>

<script type='text/javascript' src="<c:url value='/scripts/jquery-ui/js/jquery-ui-1.10.4.custom.min.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jqgrid/jquery.jqGrid.src.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jqgrid/i18n/grid.locale-tw.js${version }'/>"></script>
<script type="text/javascript">
	jQuery.jgrid.no_legacy_api = true;
</script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.jqGrid.custom.js${version }'/>"></script>
<script type='text/javascript' src="<c:url value='/scripts/jquery.fileDownload.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/ajaxfileupload.js'/>"></script>
<script type="text/javascript">
$(function(){
    $(".date").datepicker({dateFormat: 'yy/mm/dd', showOn: 'both', 
        buttonImageOnly: true, buttonImage: '<c:url value="/images/btn_list_calender.gif"/>', changeMonth: true, changeYear: true, yearSuffix: ''});
    
	$.validator.addMethod("numberLength",
			function(value, element, params) {
				var reg = new RegExp("^\\d{1,"+params[0]+"}(\\.\\d{1,"+params[1]+"})?$");
				var check = reg.test(value);
				return this.optional(element) || check;
			}, 
			"Please enter a valid number({0},{1})"
		);
	$.validator.addMethod("pwd",
			function(value, element, params) {
          	    return /[A-Z]/.test(value)
                  && /[a-z]/.test(value)
                  && /\d/.test(value);
			}, 
			"<fmt:message key='label.home.pwd.jsp.pwdRule.rule1'/>"
		);	
	$.validator.setDefaults({ 
	    onsubmit:true,
	    onkeyup:false,
	    onclick:false,
	    onfocusout: false
	});	
});

$(function(){
	var msg = new Array();
	defaultOpts = {
		errorPlacement:function(error,element){
			var val = error.text();
			if ($.inArray(val, msg)==-1) {
				msg.push(val);
			}
		},
		showErrors:function() {	
			msg = new Array();
			this.defaultShowErrors();
			if (msg.length > 0) 
			alert(msg.join("\r\n"));
		}
	}
	$.fn.basValidate=function(options){
		var opts = $.extend({},options, defaultOpts);
		this.each(function(i,p){
			$(p).validate(opts);			
		});		
	};
});
$(function(){
	$.fn.serializeObject = function()
	{
	    var o = {};
	    var a = this.serializeArray();
	    $.each(a, function() {
	        if (o[this.name] !== undefined) {
	            if (!o[this.name].push) {
	                o[this.name] = [o[this.name]];
	            }
	            o[this.name].push(this.value || '');
	        } else {
	            o[this.name] = this.value || '';
	        }
	    });
	    return o;
	};	
});
var win;
function openWin(url, width, height) {
	if (win) {
		win.close();
	}
	win = window.open(url, "appmanagerwin", "width="+width+", height="+height);
	win.focus();
	return win;
}
</script>
<link rel="stylesheet" type="text/css" href="<c:url value='/styles/displaytag.css${version }'/>"/>
<link rel="stylesheet" type="text/css" href="<c:url value='/styles/default.css${version }'/>">
<link rel="stylesheet" type="text/css" href="<c:url value='/scripts/jquery-ui/css/custom-theme/jquery-ui-1.10.4.custom.min.css${version }'/>"  />
<link rel="stylesheet" type="text/css" href="<c:url value='/scripts/jqgrid/ui.jqgrid.css${version }'/>"  />
<link rel="stylesheet" type="text/css" href="<c:url value='/styles/ui.jqgrid.custom.css${version }'/>"  />
<link rel="shortcut icon" href="<c:url value='/images/icon1.ico'/>"> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
